import http from "../request";
const apibase = "/api/PulicBatchRecord";

//获取条件类型数据
var getDataTypes = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/GetDataTypes`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

//获取约束条件数据
var addDataTyped = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/AddDataTyped`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

//获取流程数据
var getApprovalProcesss = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/GetApprovalProcesss`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

//获取字典数据
var getDictionaryDataSources = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/GetDictionaryDataSources`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};
export {
  getDataTypes,
  addDataTyped,
  getApprovalProcesss,
  getDictionaryDataSources,
};
